package com.opennice.soukaoti.index.util;

import java.io.File;
import java.io.IOException;

import net.paoding.analysis.analyzer.PaodingAnalyzer;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.Term;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.util.Version;

public class IndexTools {

	public static void getDoucmentSum(){
		try {
			File dataFile = new File("D://indexFile");
			Directory directory = FSDirectory.open(dataFile);
            IndexReader reader=IndexReader.open(directory);
			System.out.print("Next  Document ID optimize: ");
			System.out.println(reader.maxDoc());
			System.out.print("Total Document Num optimize: ");
			System.out.println(reader.numDocs());
			reader.close();
		}catch (IOException e) {
			e.printStackTrace();
		}
	}
}
